Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureComms: Add testing facility for e2e tests #2124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidhadas
Copy link
Member

@davidhadas davidhadas commented Oct 22, 2024

Modify the .github/workflow files to enable adding e2e tests for secure comms.
The added code is generalized to enable controlling the libvirt e2e testing matrix using a json file

@davidhadas davidhadas requested a review from a team as a code owner October 22, 2024 09:02
@davidhadas davidhadas self-assigned this Oct 22, 2024
@davidhadas davidhadas added the test_e2e_libvirt Run Libvirt e2e tests label Oct 22, 2024
@davidhadas
Copy link
Member Author

davidhadas commented Oct 22, 2024

This PR is expected to fail when using the existing workflow and succeed when using the modified workflow.

It fails now since the existing workflow calls config_libvirt.sh without a parameter
The config_libvirt.sh without a parameter returns the list of e2e tests instead of actually installing libvirt et al.
This results in make e2e_tests failure later on (since libvirt and other packages were not installed).

As an alternative we could create a new script (e.g. config_libvirt_matrix.sh) that will return the list of matrix options.
Then, as part of the new workflow, we can call this script instead of calling config_libvirt.sh without parameters.
The only benefit that I see from this is to allow the existing workflow to pass the e2e tests of this PR.
(I am not sure this justifies introducing another script)

.github/workflows/e2e_libvirt.yaml Outdated Show resolved Hide resolved
.github/workflows/e2e_run_all.yaml Outdated Show resolved Hide resolved
@davidhadas davidhadas force-pushed the secComms_test branch 2 times, most recently from 4f3837e to c5e6e99 Compare October 22, 2024 19:03
Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking cool - thanks for adding the matrix json, this could be a really good pattern assuming it works fine 😄

Comment on lines 124 to 132

# switch to the appropriate e2e test and add configs to libvirt.properties as needed
case $TEST_E2E_SECURE_COMMS in

*)
echo "processing none"
;;
esac
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this debug here given that it is echo'd above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should stay here as it is the basis of what we will do next - e.g.:

# switch to the appropriate e2e test and add configs to libvirt.properties as needed
case $TEST_E2E_SECURE_COMMS in

  "withoutKbs")
    echo "processing withoutKbs"
    echo "SECURE_COMMS=\"true\"" >> libvirt.properties
    echo "SECURE_COMMS_KBS_ADDR=\"false\"" >> libvirt.properties
    echo "INITDATA=\"\"" >> libvirt.properties
    ;;

  *)
    echo "processing none"
    ;;
esac

It maybe better to remove the earlier echo "SECURE_COMMS is ${TEST_E2E_SECURE_COMMS}" if it feels we are putting too much output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't you add that in when you start using it? At the moment it's not doing anything useful?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myabe the right thing to do is to spell this out more clearly by adding echo "SECURE_COMMS=\"false\"" >> libvirt.properties

So we will have:

# switch to the appropriate e2e test and add configs to libvirt.properties as needed
case $TEST_E2E_SECURE_COMMS in

  *)
    echo "processing none"
    echo "SECURE_COMMS=\"false\"" >> libvirt.properties
    ;;
esac

Will this do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's okay, it won't be used by anything, so I still don't understand the need for it in this PR, but 🤷

Modify the .github/workflow files to enable addting e2e tests for secure
comms.

Signed-off-by: David Hadas <[email protected]>
Signed-off-by: David Hadas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_e2e_libvirt Run Libvirt e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants